package com.orange.lswidget.widgets.musicplayer.service;

import android.os.RemoteException;

import com.android.music.IMediaPlaybackService;
import com.orange.util.LogHelper;

public class AcerMPService implements IMusicPlayerService {
	private static final String		TAG	= "AcerMPService";

	private IMediaPlaybackService	mMps;

	public AcerMPService(IMediaPlaybackService mMps) {
		this.mMps = mMps;
	}

	@Override
	public long getAlbumId() {
		try {
			return mMps.getAlbumId();
		} catch (Exception e) {
			LogHelper.d(TAG, "getAlbumId. e. [=" + e);
		}
		return 0;
	}

	@Override
	public String getAlbumName() {
		try {
			return mMps.getAlbumName();
		} catch (Exception e) {
			LogHelper.d(TAG, "getAlbumName. e. [=" + e);
		}
		return "";
	}

	@Override
	public String getArtistName() {
		try {
			return mMps.getArtistName();
		} catch (Exception e) {
			LogHelper.d(TAG, "getArtistName. e. [=" + e);
		}
		return "";
	}

	@Override
	public long getAudioId() {
		try {
			return mMps.getAudioId();
		} catch (Exception e) {
			LogHelper.d(TAG, "getAudioId. e. [=" + e);
		}
		return -1;
	}

	@Override
	public String getTrackName() {
		try {
			return mMps.getTrackName();
		} catch (Exception e) {
			LogHelper.d(TAG, "getTrackName. e. [=" + e);
		}
		return "";
	}

	@Override
	public boolean isPlaying() {
		try {
			return mMps.isPlaying();
		} catch (Exception e) {
			LogHelper.d(TAG, "isPlaying. e. [=" + e);
		}
		return false;
	}

	@Override
	public int getMediaMountedCount() {
		try {
			return (int) mMps.getAudioId();
		} catch (Exception e) {
			LogHelper.d(TAG, "getMediaMountedCount. e. [=" + e);
		}
		return 0;
	}

	@Override
	public String getPath() {
		try {
			return mMps.getPath();
		} catch (Exception e) {
			LogHelper.d(TAG, "getPath. e. [=" + e);
		}
		return "";
	}

	@Override
	public long duration() {
		try {
			return mMps.duration();
		} catch (Exception e) {
			LogHelper.d(TAG, "duration. e. [=" + e);
		}
		return 0;
	}

	@Override
	public long position() {
		try {
			return mMps.position();
		} catch (Exception e) {
			LogHelper.d(TAG, "position. e. [=" + e);
		}
		return 0;
	}

	@Override
	public long seek(long pos) {
		try {
			return mMps.seek(pos);
		} catch (Exception e) {
			LogHelper.d(TAG, "seek. e. [=" + e);
		}
		return 0;
	}

	@Override
	public void next() {
		try {
			mMps.next();
		} catch (RemoteException e) {
			LogHelper.d(TAG, "next. e. [=" + e);
		}
	}

	@Override
	public void prev() {
		try {
			mMps.prev();
		} catch (RemoteException e) {
			LogHelper.d(TAG, "prev. e. [=" + e);
		}
	}

	@Override
	public void pause() {
		try {
			mMps.pause();
		} catch (RemoteException e) {
			LogHelper.d(TAG, "pause. e. [=" + e);
		}
	}

	@Override
	public void play() {
		try {
			mMps.play();
		} catch (RemoteException e) {
			LogHelper.d(TAG, "play. e. [=" + e);
		}
	}

	@Override
	public void stop() {
		try {
			mMps.stop();
		} catch (RemoteException e) {
			LogHelper.d(TAG, "stop. e. [=" + e);
		}
	}

}
